var mongoose=require('mongoose');
const Schema=mongoose.Schema;
var mongoosePaginate=require('mongoose-paginate');
var ObjectId=Schema.ObjectId;
//定义一个普通数据模型
var CommentSchema=new mongoose.Schema({
	name:String,
	thump:String,
	date:{type:Date,default:Date.now},
	content:String,
	newsId:ObjectId
});
//将数据模型应用分页插件
CommentSchema.plugin(mongoosePaginate);//schema数据模型里使用了分页插件


module.exports=mongoose.model('Comment',CommentSchema,'comment');
